import type { TAdminReq, TAdminDisableReq } from "@/typing/admin";
import type { TAuthAddReq, TAuthDeletedReq, TAuthDisabledReq, TAuthorizedListReq } from "@/typing/authorized";
import type { TListReq } from "@/typing/base";
import alovaInstance from "@/utils/request";

export const queryAuthList = (req?: TAuthorizedListReq) => alovaInstance.Get('/api/authorized', { params: req })
export const addAuthorized = (req: TAuthAddReq) => alovaInstance.Post('/api/authorized', req)
export const disabledAuthorized = (req: TAuthDisabledReq) => alovaInstance.Patch('/api/authorized/used', req)
export const deleteAuthorized = (req: TAuthDeletedReq) => alovaInstance.Delete(`/api/authorized/${req.id}`)
// export const queryAdminMenu = (id: string) => alovaInstance.Get(`/api/authorized/menu/${id}`)
// export const editAdminMenu = (req: Record<'id' & 'actions', string>) => alovaInstance.Post('/api/authorized/menu', req)
